package com.xmut.rc.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @description: SysUser对象
 * @author: XS
 * @date: 2022/5/23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rc_sys_user")
@ApiModel(value = "SysUser对象", description = "")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @Excel(name = "用户id")
    @ApiModelProperty(value = "用户id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Excel(name = "登录账号")
    @ApiModelProperty(value = "登录账号")
    private String username;

    @Excel(name = "真实姓名")
    //@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @Excel(name = "登录密码")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "登录密码")
    private String password;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "md5密码盐")
    private String salt;

    @Excel(name = "头像")
    @ApiModelProperty(value = "头像")
    private String avatar;

    @Excel(name = "出生日期", format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "出生日期")
    private Date birthday;

    @Excel(name = "性别", replace = { "男_1", "女_2" }, suffix = "生")
    @ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)")
    private Integer sex;

    @Excel(name = "电子邮箱")
    @ApiModelProperty(value = "电子邮箱")
    private String email;

    @Excel(name = "手机号码")
    @ApiModelProperty(value = "手机号码")
    private String phone;

    @Excel(name = "账号状态")
    @ApiModelProperty(value = "账号状态(1-正常,2-冻结)")
    private Integer status;

    @Excel(name = "角色")
    @ApiModelProperty(value = "角色")
    private String role;

    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    private Integer isDelete;


    @Excel(name = "创建日期", format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建日期")
    private Date gmtCreate;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新日期")
    private Date gmtModified;


}
